// Prepare a job to copy over all old artifacts into their new destination.
let mut pairs = Vec::new();
pairs.push((old_fingerprint_loc, new_fingerprint_loc));
+
+ // TODO: this shouldn't explicitly pass false, for more info see
+ // cargo_rustc::compile_custom
+ if pkg.get_manifest().get_build().len() > 0 {
+ let layout = cx.layout(false);
+ pairs.push((layout.old_native(pkg), layout.native(pkg)));
+ }
+
for &target in targets.iter() {
let layout = cx.layout(target.get_profile().is_plugin());
- if pkg.get_manifest().get_build().len() > 0 {
- pairs.push((layout.old_native(pkg), layout.native(pkg)));
- }
for filename in cx.target_filenames(target).iter() {
let filename = filename.as_slice();
pairs.push((layout.old_root().join(filename),
fresh = FRESH,
dir = p.root().display()).as_slice()));
})
+
+test!(test_twice_with_build_cmd {
+ let p = project("foo")
+ .file("Cargo.toml", r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+ build = 'true'
+ "#)
+ .file("src/lib.rs", "
+ #[test]
+ fn foo() {}
+ ");
+
+ assert_that(p.cargo_process("cargo-test"),
+ execs().with_status(0)
+ .with_stdout(format!("\
+{compiling} foo v0.0.1 (file:{dir})
+
+running 1 test
+test foo ... ok
+
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured\n\n\
+ ",
+ compiling = COMPILING,
+ dir = p.root().display()).as_slice()));
+ assert_that(p.process(cargo_dir().join("cargo-test")),
+ execs().with_status(0)
+ .with_stdout(format!("\
+{fresh} foo v0.0.1 (file:{dir})
+
+running 1 test
+test foo ... ok
+
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured\n\n\
+ ",
+ fresh = FRESH,
+ dir = p.root().display()).as_slice()));
+})